//
//  BaseTabBarController.swift
//  edu
//
//  Created by karlzhou on 15/10/29.
//  Copyright (c) 2015年 karlzhou. All rights reserved.
//

import UIKit

class BaseTabBarController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    func addTab(title:String?,image:String?,selectImage:String?,controller:UIViewController)->UITabBarItem{
        let navContr=BaseNavigationController(rootViewController: controller)
        controller.title=title
        let barItem=navContr.tabBarItem
        if(selectImage != nil){
            barItem.selectedImage=UIImage(named: selectImage!)
        }
        if(image != nil){
             barItem.image=UIImage(named: image!)
        }
       
        //barItem.title=title
        
        self.addChildViewController(navContr)
        return barItem
    }

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
